﻿using System;
using System.Text.RegularExpressions;
class ExtractSentence
{
    static void Main()
    {
        string text = "We are living in a yellow submarine. We don't have anything else." + 
        "Inside the submarine is very tight. So we are drinking all the day. We will move out of it in 5 days.";
        Console.Write("please enter word: ");

        string word = Console.ReadLine();

        string[] sentences = text.Split('.');
        Console.WriteLine(text);

        for (int i = 0; i < sentences.Length; i++)
        {
            if (Regex.IsMatch(sentences[i], @"\b" + word + @"\b", RegexOptions.IgnoreCase))
            {
                Console.WriteLine((sentences[i] + ".").Trim());
            }
        }
        Console.ReadLine();
    }
}

